<?

$fs_ord_man_products = new Fieldset (array (
	db_conn=>$_GLOBAL_DBH,
	relation=>"ord_man_products",
	title=>"Order Products",
	fieldset=>array (
		array (name=>"id",label=>"ID",type=>"numeric",
				value=>$_REQUEST["order_product_id"],
				input=>"hidden",primary_key=>true),
		array (name=>"order_id",label=>"Order ID",type=>"any",
				relation=>array(foreign=>"ord_man_orders",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM ord_man_orders",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"product_id",label=>"Product ID",type=>"any",
				relation=>array(foreign=>"inv_ctl_prodtcs",key=>"id",
				field=>"name"),
				input=>"select",
				options=>"_app_select_query",
				options_params=>"SELECT id,name FROM inv_ctl_prodtcs",
				columns=>array (key=>"id",value=>"name"),
		),
		array (name=>"quantity",label=>"Quantity",type=>"numeric",
				input=>"field", optional=>true),
		array (name=>"unit_price",label=>"Unit Price",type=>"decimal",
				input=>"field", optional=>true),
		array (name=>"discount",label=>"Discount",type=>"any",
				input=>"field", optional=>true),
		array (name=>"line_total",label=>"Line Total",type=>"decimal",
				input=>"field"),
	),
));

$fs_ord_man_products->parse ();

?>
